package com.andia.app.browser;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;

public class ToolBrowser {

	protected Shell shell;

	protected ToolBar tBar;

	MiniBrowser miniBrowser = new MiniBrowser(shell);

	public ToolBrowser(Shell shell) {
		this.shell = shell;
	}

	/**
	 * Membuat Toolbar
	 * 
	 * @param display
	 */
	void createToolBar(Display display) {
		tBar = new ToolBar(shell, SWT.NONE);
		ToolItem tItem = new ToolItem(tBar, SWT.PUSH);
		tItem.setToolTipText("Back");
		tItem.setImage(new Image(display, "images/kiri.png"));
		tItem.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				miniBrowser.browser.back();
			}
		});

	}
}
